// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package Tracking;

public final class StopData implements java.lang.Cloneable
{
    public String location;

    public StopActionData[] actions;

    public StopData()
    {
    }

    public StopData(String location, StopActionData[] actions)
    {
        this.location = location;
        this.actions = actions;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        StopData _r = null;
        try
        {
            _r = (StopData)rhs;
        }
        catch(ClassCastException ex)
        {
        }

        if(_r != null)
        {
            if(location != _r.location && location != null && !location.equals(_r.location))
            {
                return false;
            }
            if(!java.util.Arrays.equals(actions, _r.actions))
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 0;
        if(location != null)
        {
            __h = 5 * __h + location.hashCode();
        }
        if(actions != null)
        {
            for(int __i0 = 0; __i0 < actions.length; __i0++)
            {
                if(actions[__i0] != null)
                {
                    __h = 5 * __h + actions[__i0].hashCode();
                }
            }
        }
        return __h;
    }

    public java.lang.Object
    clone()
    {
        java.lang.Object o = null;
        try
        {
            o = super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return o;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeString(location);
        stopactionlistHelper.write(__os, actions);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        location = __is.readString();
        actions = stopactionlistHelper.read(__is);
    }
}
